###########################################
#Makefile for simple programs
###########################################
INC=-I./include/ -I/usr/local/include -I/usr/local/include/opencv -I/usr/local/include/opencv2
LIB=-L/usr/local/lib/  -lopencv_core -lopencv_highgui -lpthread -lrt


CC=g++
C=g++
CC_FLAG=-Wall -g

PRG=libocr.so
OBJ=imagerecog.o ocr.o
CC_FLAG+=`pkg-config --cflags opencv`
LDFLAGS=`pkg-config --libs opencv`


$(PRG):$(OBJ)
	$(CC) -shared  $(INC) $(LIB) -o $@ $(OBJ) $(LDFLAGS)
		
.SUFFIXES: .c .o .cpp
.cpp.o:
	 $(CC) -fPIC  $(CC_FLAG) $(INC) -c $*.cpp -o  $*.o
.c.o:
	$(C) -fPIC  $(CC_FLAG) $(INC) -c $*.c -o  $*.o

.PRONY:clean
clean:
	@echo "Removing linked and compiled files......"
	rm -f $(OBJ) $(PRG)
